package com.xfb.jdbc.sqlSession;

import java.util.List;

/**
 * @Auther: Xing Fang Bin
 * @Date: 2021/07/01/11:44
 * @Description:
 */
public interface Session {

    /**
     * 查询所有
     *
     * @param statementId
     * @param params
     * @param <E>
     * @return
     */
    public <E> List<E> selectList(String statementId, Object... params) throws Exception;

    /**
     * 根据条件查询一个
     *
     * @param statementId
     * @param params
     * @param <T>
     * @return
     */
    public <T> T selectOne(String statementId, Object... params) throws Exception;

    /**
     * 插入、更新、删除记录
     *
     * @param statementId
     * @param params
     * @return
     * @throws Exception
     */
    public Integer update(String statementId, Object... params) throws Exception;

    /**
     * 为DAO接口生成代理实现类
     *
     * @param mapperClass
     * @param <T>
     * @return
     */
    public <T> T getMapper(Class<?> mapperClass);

}
